﻿using Api.Attributes;

namespace Api.Controllers
{
    /// <summary>
    /// 单据
    /// </summary>
    public class BillController : EditingBaseController<BillModel, BillFilterModel, IBillLogic>
    {
        public BillController(ICurrentUser currentUser, IBillLogic logic)
            : base(currentUser, logic)
        {
        }

        #region 提交
        [HttpPost]
        public async Task<bool> SubmitForIn([FromBody] BillModel model)
        {
            return await Task.Run(() => _logic.SubmitForIn(model));
        }

        [HttpPost]
        public async Task<bool> SubmitForOut([FromBody] BillModel model)
        {
            return await Task.Run(() => _logic.SubmitForOut(model));
        }
        #endregion

        #region 退回
        [HttpPost]
        public async Task<bool> BackForIn([FromBody] BillModel model)
        {
            return await Task.Run(() => _logic.BackForIn(model));
        }

        [HttpPost]
        public async Task<bool> BackForOut([FromBody] BillModel model)
        {
            return await Task.Run(() => _logic.BackForOut(model));
        }
        #endregion

        #region 确认
        [HttpPost]
        public async Task<bool> ConfirmForIn([FromBody] BillModel model)
        {
            return await Task.Run(() => _logic.ConfirmForIn(model));
        }

        [HttpPost]
        public async Task<bool> ConfirmForOut([FromBody] BillModel model)
        {
            return await Task.Run(() => _logic.ConfirmForOut(model));
        }
        #endregion
    }
}
